<script setup>
  import {ref,onMounted} from 'vue';
  import ajax from './utils/myaxios.js'

  let msg = ref('');

  //https://api.uomg.com/api/rand.qinghua?format=json  或者使用 

  let getMsg = async ()=>{
      let {data:{content}} =  await ajax.get("/api/rand.qinghua",{params:{"format":"json"}});
      msg.value = content;
  }

  onMounted(()=>{
    getMsg();
  })



</script>

<template>
  <div>
     今日情话3： {{ msg }}  <br>
     <button @click="getMsg()">切换</button>
  </div>
</template>

<style scoped>

</style>